<?php

Class CBaseAdvertisements extends CBaseEosPlural {


	public function __construct() {
		parent::__construct();
		return true;
	}

	public static function fetchAdvertisements( $objDatabase ) {

		$strSql = 'SELECT * FROM `advertisements`';
		return parent::fetchResults( $strSql, 'CAdvertisement', $objDatabase );
	}

	public static function fetchAdvertisementById( $intId, $objDatabase ) {

		$strSql = 'SELECT * FROM `advertisements` WHERE `id` = ' . $intId;
		return parent::fetchResult( $strSql, 'CAdvertisement', $objDatabase );
	}

	public static function fetchAdvertisementsByModuleId( $intModuleId, $objDatabase ) {

		$strSql = 'SELECT * FROM `advertisements` WHERE `module_id` = ' .$intModuleId;
		return parent::fetchResults( $strSql, 'CAdvertisement', $objDatabase );
	}

	public static function fetchAdvertisementsByAdvertisementTypeId( $intAdvertisementTypeId, $objDatabase ) {

		$strSql = 'SELECT * FROM `advertisements` WHERE `advertisement_type_id` = ' .$intAdvertisementTypeId;
		return parent::fetchResults( $strSql, 'CAdvertisement', $objDatabase );
	}
}
?>